module.exports = {
  up: function(migration, DataTypes, done) {
    // add altering commands here, calling 'done' when finished

    migration.createTable('locations',
      {
        id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true },
        user_id:     { type:DataTypes.INTEGER  } ,
        title:       { type:  DataTypes.STRING },
        url:         { type:  DataTypes.STRING },
        faviconUrl:  { type: DataTypes.STRING  },
        marked:      { type: DataTypes.BOOLEAN },
        added:       { type: DataTypes.DATE    },
        createdAt:   { type: DataTypes.DATE    },
        updatedAt:   { type: DataTypes.DATE    },
      },
      {
        engine: 'InnoDB', // default: 'InnoDB'
      }
    )

    done()
  },
  down: function(migration, DataTypes, done) {
    // add reverting commands here, calling 'done' when finished
    migration.dropTable('locations')
    done()
  }
}
